/* KindEditor 自定义样式 */

/* 编辑器容器 */
.ke-container {
  border: 1px solid #ddd !important;
  border-radius: 4px !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
}

/* 工具栏样式 */
.ke-toolbar {
  background: #f8f9fa !important;
  border-bottom: 1px solid #e9ecef !important;
  border-radius: 4px 4px 0 0 !important;
}

.ke-toolbar .ke-outline {
  border: none !important;
}

.ke-toolbar .ke-toolbar-icon {
  background-color: transparent !important;
  border: 1px solid transparent !important;
  border-radius: 3px !important;
  transition: all 0.2s ease !important;
}

.ke-toolbar .ke-toolbar-icon:hover {
  background-color: #e9ecef !important;
  border-color: #adb5bd !important;
}

.ke-toolbar .ke-toolbar-icon-on {
  background-color: #007bff !important;
  border-color: #007bff !important;
}

.ke-toolbar .ke-toolbar-icon-on:hover {
  background-color: #0056b3 !important;
  border-color: #0056b3 !important;
}

/* 编辑区域 */
.ke-edit {
  border-radius: 0 0 4px 4px !important;
  background: #fff !important;
}

.ke-edit iframe {
  border: none !important;
}

/* 状态栏 */
.ke-statusbar {
  background: #f8f9fa !important;
  border-top: 1px solid #e9ecef !important;
  border-radius: 0 0 4px 4px !important;
  padding: 4px 8px !important;
  font-size: 12px !important;
  color: #6c757d !important;
}

/* 编辑器内容区域 */
.ke-content {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
  font-size: 14px !important;
  line-height: 1.6 !important;
  color: #212529 !important;
  padding: 12px !important;
}

.ke-content p {
  margin: 0 0 12px 0 !important;
}

.ke-content h1, .ke-content h2, .ke-content h3, 
.ke-content h4, .ke-content h5, .ke-content h6 {
  margin: 16px 0 8px 0 !important;
  font-weight: 600 !important;
  color: #495057 !important;
}

.ke-content ul, .ke-content ol {
  margin: 0 0 12px 24px !important;
  padding: 0 !important;
}

.ke-content li {
  margin: 4px 0 !important;
}

.ke-content blockquote {
  margin: 12px 0 !important;
  padding: 8px 16px !important;
  border-left: 4px solid #007bff !important;
  background-color: #f8f9fa !important;
  color: #495057 !important;
}

.ke-content table {
  border-collapse: collapse !important;
  width: 100% !important;
  margin: 12px 0 !important;
}

.ke-content table td, .ke-content table th {
  border: 1px solid #dee2e6 !important;
  padding: 8px 12px !important;
  text-align: left !important;
}

.ke-content table th {
  background-color: #f8f9fa !important;
  font-weight: 600 !important;
}

.ke-content img {
  max-width: 100% !important;
  height: auto !important;
  border-radius: 4px !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
  margin: 8px 0 !important;
}

.ke-content a {
  color: #007bff !important;
  text-decoration: none !important;
}

.ke-content a:hover {
  color: #0056b3 !important;
  text-decoration: underline !important;
}

/* 响应式调整 */
@media (max-width: 768px) {
  .ke-container {
    border-radius: 2px !important;
  }
  
  .ke-toolbar {
    padding: 4px !important;
  }
  
  .ke-toolbar .ke-toolbar-icon {
    width: 24px !important;
    height: 24px !important;
    margin: 1px !important;
  }
  
  .ke-content {
    padding: 8px !important;
    font-size: 13px !important;
  }
}

/* 只读模式样式 */
.ke-container.ke-readonly {
  background-color: #f8f9fa !important;
  border-color: #e9ecef !important;
}

.ke-container.ke-readonly .ke-edit {
  background-color: #f8f9fa !important;
}

/* 评论编辑器的特殊样式 */
.comment-editor .ke-container {
  min-height: 120px !important;
}

.comment-editor .ke-toolbar {
  padding: 6px !important;
}

/* 内部备注编辑器样式 */
.internal-note-editor .ke-container {
  border-color: #ffc107 !important;
}

.internal-note-editor .ke-toolbar {
  background: #fff3cd !important;
  border-bottom-color: #ffeaa7 !important;
}

/* 解决方案编辑器样式 */
.resolution-editor .ke-container {
  border-color: #28a745 !important;
}

.resolution-editor .ke-toolbar {
  background: #d4edda !important;
  border-bottom-color: #c3e6cb !important;
}

/* 错误状态 */
.has-error .ke-container {
  border-color: #dc3545 !important;
  box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25) !important;
}

/* 焦点状态 */
.ke-container:focus-within {
  border-color: #80bdff !important;
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25) !important;
}

/* 工具提示 */
.ke-toolbar .ke-toolbar-icon[title]:hover::after {
  content: attr(title);
  position: absolute;
  bottom: -30px;
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: #fff;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  white-space: nowrap;
  z-index: 1000;
  pointer-events: none;
}

/* 加载状态 */
.ke-container.loading {
  opacity: 0.6;
  pointer-events: none;
}

.ke-container.loading::after {
  content: '加载中...';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(255, 255, 255, 0.9);
  padding: 8px 16px;
  border-radius: 4px;
  z-index: 1000;
}